Toss in some error checking.