Adding in more error handling

Signed-off-by: Joe Buck <jbbuck@gmail.com>