Fix console warnings about undefined variables