Fix bug cannot clone layout

Fix #336