Some re-formatting of code for readability.
completion: Fixed retrieving set index.