Fixed out of bounds exceptions in command parsing.