Handle some error scenarios - another perf improvement