Patch/stdgen tidy

Some tidy up to the standard generator including some PMD fixes.