Fixed memory leaks in all engine commands and some artiste commands