rework InaSAFE, also fixes #147

Signed-off-by: Werner Macho <werner.macho@gmail.com>