Fixing a couple crashing bugs.