Support for error branches and some enhancements