Implemented local fix from issue #191