Fix several minor issues