Fixing PR 172

Just noticed that my previous fix was faulty. Sorry for the mess. Shouldn't code tired...