This is OK for now, but if my branch ever gets reintegrated we shouldn't rely on doing this in Lua.