Fixed nasty bug caused by "required" flag