Added checking for null argument.

Closes #31