Patch to prevent problems like Issue #381