Implemented fix for issue #499