Fix backend error handling