NPE Handler, fixed tests

Added NPE Exception handler and fixed user tests.