various fixes for working in production mode, ie rails s -e production