fix bug when REMOTE_CMD was the last parameter, improved error message