Fix bugs for enhanced apply models