MHAPI code review bug fix