Code cleanup and fixes after Express 4.x