trq-2174 Put in some error checking.