Fixed custom Dir[] and Dir.glob methods and updated tests for them.