Fixed compiler warnings

Plus fix for compilation error introduced when tidying portable build