Converted https://github.com/timvideos/planet/commit/25b9ce1e761dfe3bd7dab7de2995e4c6b7d9c097