A missing break and some code simplification.

See individual commit messages.