Fix #2207

@Lukasa wrote the fix in #2207
Merge pull request #2210 from sigmavirus24/bug/2207

Fix #2207