Safety state machine updates. Not ready for merging yet.