Rails vulnerability fix and requested changes from ENV

@dthompson 

Hi Mick, can you please review? Been a while since I've made changes to the app. Thanks!