Minor refactoring, fix bitwise comparison in C
Add the missing scan types
Remove env shutdown
Bring back tests