Remove unnecessary null pointer checks

Fixes #225.