Some fixes
Reverting Ganster 41 commit (cc79305).
As of erikcas commit 631e32d.