fixes issue #142 messy validation

Fixes #142 
Seriously, all of this and most of the ugly bugs I have are because turns out something is null and nothing checks if it is, ever.