some tiny bits of cleaning

just a little bit of code cleaning, mostly unused globals, typos and other small stuff..