WIP: compiles but segfaults

Change-Id: I9180cce80f4683a4eaf4fa6ab7508837762f877a