Attempt fix for issue #287 and issue #290