Fixes failing unit test in layoutDidChange.  Closes #1047.