Updated processcommand validation code.