Don't get wedged when something unexpected happens

Change-Id: I5f855b07ddeb9f1085fcd54f0073b752f3da6ace