Fixed memory leaks in smon logic