Bug 1373 - Fixed NullPointerException on incorrect input