Fixed minor bug where errors weren't being reset to null