Fixed function clause bug