Fix for #199 - detroy method not cleaning up properly