Added as.state.last_error for easier failure analysis