Fixed type and removed old code