Fix broken function, add type completion