Added handling for additional error cases