Fix bug causing double commands and stuff
Fix up a few logic bugs with my fix