Make sure right class is used for object without id