Fixes to remove various warnings and minor errors.