Fixed a bug in optional assignment