fixed compile errors, tested build