Fixes dir not ending with /.