Implements issue #24