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