References #1869, #1872: Fixed issues involving dynamically loading/unloading layouts