Switch to critical sections, fix some possible minor nits with ISR