make it a little more pythonic
more coverage, some minor utility fixes