Fixed setLayoutEnabled.

closes #2334