Tidy continues and simplify some `if` blocks

Add `continue` when we encounter an error and tidy some `if` statements.