fixes extract with empty inputs
fixes several tests