Fixed bug when default class is not instantiated