Fixed some type bugs.