Adds test and fix for issue #82