Bugfixes. Emitter is now a bit smarter about locals.