Common library: fix dynamic array swap method by adding swap of the last buffer index instance variable.