Util tests and a couple small fixes.