Added error-prone bug checking to build lifecycle of Ninja.