slight improvements to command parsing