cleanup glob code
tests still fail
fix more remarks by piojo