Fixed autocomplete. TODO DRY. This fixes #12