Fixes issue 8504