A few improvements

Hi @willmorgan, here are a few improvements I've made.

Sorry they are all bunched up - I consider them fairly minor, and they are all backwards compatible.

Happy to split up into separate pull requests, if needed.
I thought there'd be no harm in always being secure, but I guess its good to give devs the option. Also laziness after copy+paste. Will change.