Proper error checking.