fix segfault. Closes T1286