Fixed bug with bubble sort, added tests