Fixing variable assignment