some error handling changes, etc