Fixed the bug that threw exception on using '~'

'proper' function in strings.py was including a '' as a variable name
when a '~' operator was used. This raised an exception when trying to
make the truthtable. Fixed it.