some fixes to amounts not being stored correctly