Detect debug mode from environment.
Fixed put the code in wrong command.