Removed unused variables, small syntax fixes.