fix some compile and require bugs