Fix for Issue 330

Fix for #330.
It's late, pls double check that it's working...