Fixing compile errors and adding util class