fix typos and inefficient type conversion warnings

no functional changes, just some cleanup to see less warnings in my workspace
This could be a UK vs US locale thing, I don't get a warning for the above. But glad to change, as this variant will probably be more widely accepted :)