Updated code to correctly integrate with Connect static and directory middlewares.