Fix function def bug