Some code cleanup, fixes bash completion.