Not sure if this is the right place for this bug but I believe it is. The function get_max_num_msg() was returning the incorrect member.