Merge back from develop

Now we just need Gendarme compliance...