Fixes for a couple of crash bugs.