Fixed a bug affecting setting variables