Make the merged code work again. Also fixs a SEGV.