fixed offsetof strangeness in g++
fixed friend error in g++