Add more unit tests for util.