(Mostly) fixed compiling.