[FOLD] test utils, fix bugs