fixed typos and missing vars