Error handling in the wrapper. Update test