DDF-169 Implement null checks and fix generic Exception

Also adds tests