Fixes directory middleware for windows paths