fixes to work with gcc