Error checking.

Signed-off-by: Matt Hoover <the.one.eleven@gmail.com>