Fix #306: Remove unnecessary null pointer checks