Improvements to compilation; cleaning up of warnings