Fix mouse parser and rework contexts.