Bugfix + extra test

- Added a test to ensure mutliple inserts do not corrupt the cache
- Fixed a bug that occured when multiple inserts occured in parallel