Fixed NullPointerException reported from user