Fix more crashes and change things to follow conventions.