Remove deprecated option --debug, fix #917

and remove code related with '--debug'