Fixed bug with units being put in wrong input state