Fixed __getstate__ problem as discussed