Clean up SV class definition when using valgrind.

Also fix a memory leak when compiling class properties.