Fix 3 trivial (possible) errors, discovered by covertity.com