hiddenattributes and visibility settings incorrect

Fixes #1238