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.
Sorry for being pedantic, but can you add a trailing comma to the final items in an array? Thanks