Fixes issue #496