Handle reading and writing of multiple IDB:s, write IDB options and use correct lengt...