Fixed a bug in global models