Fix bastien bugs + tests