Fix faulty variable assignment