Converted https://github.com/timvideos/planet/commit/c00b3deb2a813d49b1b44708277e3a93140b067b