Fix bubble sort with some tests