Trying to improve error catching

Signed-off-by: Joel Jensen <yobert@gmail.com>