Fix slow saving

This fixes issue #183 for me. I am not sure whether this fix has any side effects, but in the three months I was using it I did not experience any problems caused by it.