cleanups
prevent path traversal
case-insensitive comparison on windows