Minor typos, use statements and variable names fixed