Start adding utils tests. Fix some utils bugs