Fix metadata command not updating self (#2515)* Fix metadata command not updating self* Remove redundant check* Use direct casting (commit: d3010de)