Fix for issue #546