Changed implementation according to proposal by @dblock.
Updated change log.