Apply second patch from issue350