Attaching a patch that should solve this issue.