#57 - Fixed bug introduced in #47

This also restored the speed loss caused by that PR.