Fixes for errors and warnings on Ubuntu