Add some safetly to mods
don't shadow mod_data
more type checks