Fixed segfault on change layout and following rec/play