Fixed issue with incorrect variable assignment

Variable assignment should now be properly performed.