checkErr is only used in two conditionals, and the errors generated can exist within the scope of those conditionals. It's confusing to define checkErr at this scope, anyways, so let's just drop it.