Fix and cleanup for auto-layout demo