fix memory leaks and compiler warnings in LXVST code