Changed "getError" to "lastError" to better reflect the semantics of the method.