Fixes to #59

Fixes my mistake with #59, Thanks Wally.

Also moved assignment of *data out of the if block since it was being executed regardless.