Making the save state functions compatible with typed arrays