Fixed NullPointerException.

Resolves issue #208.