[#3022][#3258] Enhancing example at @ggam's suggestion
[#3258] A bunch of fixes thanks to @WouterJ