Fix #1262

Credit: The fix is by Lusito who is too lazy to make a pull request for such a small change.