Handle some errors better