fix type bugs.