Finished changes plus fxed compile errors.