Inheritance fixes, style fixes. No functional change.
Various fixes, style and java warnings mostly.