Added proper handling of nulls
Added some security to filthy-tricks