fix typos and bugs in build_model, macros.py