Some fix ups in commandhandler and a fix for setowner