Fixed lua compile errors on Redhat Linux and building stuff