Fix class initialization and clone