Key unit tests and null checks