Some fixes for mib generation. Fixed tree construction.