Fix for missing assignments (credit to @emrahtoy)