More error checking