possible fix for #14

@tkurki 

What do you think of this fix for the issue? It's as basic as it gets, but should do the job. I'm a bit unsure I'm not forgetting anything, because this seems too easy...