Only make '.' electric if there is a valid residue

This prevents completions in situations such as [ 1 .