
Thanks to:

- Soren Hojsgaard for some useful suggestions.
- Jussi Lehto for pointing out a bug and providing a fix.

