Fix ternary writting
Change local to locale (cf #203)
Make the source code easier to read