bug fixes for older gcc versions