libcmd fixes