Fix bug with internal inventory types in templates.
Fix bug with internal inventory types in templates.

Bug appeared because in history creating did not checked inventory as int.

Closes polemarch/ce#125

vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch