Python 3 fix for slots. Closes #1721