[FOLD] Compile and bug fixes