Fixed issue:
Importing records from json, inventory is not reliable. #19
Also fix other related issues.