Bugfix. Also, added ability for server to remove the old records automatically.