I finally reverted most of this commit here:
https://github.com/brainstorm-tools/brainstorm3/commit/00529e18848591d7d808242d1e3e45e08b4738e6
It was causing a lot of trouble in reading the EDF annotations.
See the discussion at the end of the github commit for more information.
See this other thread: Importing. Index exceeds the number of array elements