Added echoParams to debug statement.
Minor refactoring.