Fix bug in subscript of buffer, endIndex of a half closed range seems to be +1 what was expected already