Minor fixes for older gcc and cleanup