Correcting some bugs in model_complete_implicit.c