Sorry about the mix of changes. This came from a separate project where the feature was developed, rather than being worked on from master, but point taken.