Portability and compiler warning fixes.