Updated: fixed some (not all) compile errors