Polishing implementation of filling interval gaps. (Not working always!)