Smallfix.
Code cleanup.
Merge pull request #3790 from Segrain/master

Bugfixes.