Add build fix from #2435
Merge pull request #3185 from sryze/patch-1

Add build fix from #2435