Small error checking changes