Refactored error handlers and vector references.