Fixed bug in setting hidden properties.

Added serialization tests for hidden properties.