Fix bug which did not use path expantion for path checks