Moved some command parsing, fixed some issues