Fix class creation

fixes #29