Not sure how it all of a sudden started working. For all I know it was the presence of MrNumbers in chat helping me going thru possible solutions.
Started by rfielder
Started by MrNumbers
Started by danisthirty