Fix FID context management
Improve FID to device mapping management and fix a memory leak