Added changes to make globbing more robust