Fixed some typos and moved protection checking to its own class.