Fix API and exception for current specs.