Bugfix palette

Fixes #978

Also removes weakrefs, since I don't see their point here.