[FOLD] fixes and unit test