Error function.