Fixed bugs (message being referenced before assignment)