Converted https://github.com/timvideos/planet/commit/5efb5d4c054a2b93226fe5e796905983782f99bf