Move improvements to sample-exact controller handling,

also some coding style fixes