Fixed to type errors after functions changed.