Simple Corrections to Logic

This is why it's better to use a Regex