Fixes issue #1036