removed trailing whitespaces and space filled lines
fixed method_missing for ruby 2.0 and switched debugging to env variable