Fixes to make things work inside moai