Fix
Auto-rehashing added as well as a test