toInt(), refactor shiftLeft() and shiftRight()

used toInt() in shift functions to replace addition with zero. Corrected
an error in removeDList() where there was an unnecessary else if
(changed to else) and the memory that 'element' was assigned to was
erroneously freed.