gcc port; tidy up