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