fix compilation errors, move util to core