Merge changes and do some (subjective) code improvements.
Authored by: hagru 2015-02-06
Parent: [r222]
Child: [r224]