Various bug fixes

Various bug fixes to how data is stored, handled, exported