This should fix issue #42

I'm sorry, but no test cases just yet.