fixed build errors for g++