Fixed bug where visibility could always be set for fields.