Fixes and clean-up.
Jip fix.
Merge pull request #494 from headswe/dev

Fixes and clean-up.