more minor fixes and refactoring in mono