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