Fixed a number of issues related to getting Physics and Lua working together.