Added more tests and removed redundant null checks