Fix undefined issues in completion

Completion was broken, this fixes it.