Fix exception for empty class