Merge pull request #1 from bartwo/master

First test on actual server
Merge pull request #2 from bartwo/master

cleanup
cleanup code, warnings gone