Probably due to improper initialization of an array. You probably got back no data, but since I didn't initialize the array it probably messed up a lot of other data returns.

I know you were under the gun to get something done so can't really help you out, but I'll try to take a go through the code again within the next couple weeks.