Common fix for FINAL_SUPERTYPE and FINAL_UPPER_BOUND errors