Fixing cross-thread and access issues. Unbreak layout demo code.