Tab complete in middle of text deletes extra characters

Tab completing in the middle of a block of code, i.e. hitting tab and selecting an option with text to the right of cursor, deletes an extra character.