Fixing compile issues, tests pass