Slight speedup/cleanup in Shiny server.r