Build fixes for the ports and some warning fixes.