fix memory leak in static objects, #16
fix memory leaks, Closes #16