Fix: wrong implementation of __getstate__ protocol