Fix case where command begins with space

Input begining with space caused a segmentation fault