Fixed error response serialisation bug.