Fixed a bug where containerWidth would be 0 after a layoutMode change