Small fixes, something wrong with sorting