Added missing test for invalid reference corner case
Implemented memory management for openddl::detail::Command