Fixed errors in refgen diagnostic handling.