Fix clang compilation (thanks to solstice)
Optimize loop (thanks to cand)
Merge remote-tracking branch 'upstream/master'
Merge pull request #1387 from leyyin/master

Fix embarrassing clang compilation mistake (thanks to solistice and cand).