Fixed command options and queue handling, refactoring