Logical Operator Fixes

Use `&&` rather than `and` and `||` rather than `or` to avoid some potential issues.