Fix to misspelling, renamed configuration variable, and removed duplicated code