Variable misuse fixed