minor cleanups
added some tests