Invalid path detection improved..