Another round of generic code improvements ;

 hints provided by Netbeans/plugins

at least one bug fix marked with //DW