Fix error in production 'undefined method settings for nil:NilClass'