Contains various bug fixes and addresses a few race conditions. Change-Id: Ifd86c29c49c7a2c5f45d2539a48dde011e488a35