Fixed NullPointerException when hash was empty