Fix error constructor shim

Error constructor should work even when calling without `new`