fixed bugs and exploited the fi_activate_inst