Fixed an bug that caused a 'NullPointerException'