type fix in cards.js, some card sanity checks and add missing files