added the parts of #541 that I like
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel