Fixes regression with layout styles where switching from centered to non-centered layouts would fail to remove the margin styles.

Includes unit test.