Somewhat fixed mouse node handling. Code must be rewritten though.