Sync with https://github.com/tapted/bleeding_edge/commit/e6d983d