Optimized last error