Fixed bug: shell properly executes first command. Added debug parameter.