Converted https://github.com/timvideos/planet/commit/8acbef0f4a14efa89606b9531dd0e379154772a4