Fixed type bugs