various bug fixes to curriculum inventory export 

see commit messages for details.