Fix function typo, causing bug