Fix error paths