Fixed memory leak
Tagged version 0.5.18