Fix some issues Andrew found.