fixed compile errors from toy refactoring