Fix bug preventing optional functions