some fixes for g++