Bugfixing sync storage code