Correct bug registering and deleting markers.
Python 3 related bug.