Added tests to check for null pointer exceptions