Fixed a NullPointerException