Fix null pointer dereference, and pebble layouts.