Fixed many automatons to match the test cases. Still needing a clean-up though, the code is messy.