Fix variable names.
Less repetition.
Merge branch 'dev'