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