Adds debugging for yaml parsing and fixes sorting bug