Improved handling of optional value remove.