Fix for #187

This should fix the bug I mentioned before.