Fixed the NullPointerException, hopefully for the last time!