Fix nil class issue