Speed up compilation time for luafunctions

* Other compile fixes for gcc