Fixed bug when firstly allocated instance released twice in some class clusters

See #138 for details
Merge commit '2ac86efa41523b3705395e726683df5e6883c54c'