mali_control: fixes and refactorings