Problem handling text

A couple of things:

  1. I'm not sure you can do command[0] = Serial.read().

You probably want command.setCharAt(0, Serial.read()).

  1. Serial.read is probably going to return a signed integer, and I believe String treats its characters as unsigned bytes, so you'll have to make sure to convert. If no character is available, Serial.read() will return -1 - so you probably want to check for that as well.