Stronger check against directory traversal.