Bug 1413

https://gist.github.com/magul/3eb6e52aeb9568524964