A prettier fix for #36

A prettier fix for #36
My last is a hotfix. This patch behaves exactly the same as the last one but is much more prettier and cleaner.
Maybe you can merge this and stack it until the next release.