hackily fixed compile errors :(