fixed some stuff to compile under linux