Fixed bug in command flag processing