Added missing error checking introduced by earlier commit.