Fixed a bug with a variable not being set