Fix several issues relating to username case sensitivity.
Merge remote-tracking branch 'origin/master'