fix types in finalization