Cleaned up some path expansion issues and matching.

I did this so that relative paths would work properly.