Fixes several minor issues