#604 Fixed memory leak in similarity server that was occurring when computing transformation history a lot of times