Partial backout of 99b9d0d9c (for regression in Canabalt)
Merge pull request #1180 from yurydelendik/canabalt

Partial backout of 99b9d0d9c