Some error handling fixed