fix a test, add a flat dir test, sort out build deps