Fixed compile errors and added missing files