fixed typo\r\nadded check for null or unedfined to last argument in each command in…