Fixed a couple bugs in parsing and tightened up autp-complete logic.