Fixing possible NullPointerException.

Fixes #2.