Trying to fix issue #3 (Patch by Caspar Smit)