FIX: Added more checks for setValueAt method to avoid errors.