Do more error checking