Fix virtual directory without trailing slash problem