Characteristic ideals and Selmer groups