Model fixes plus lua fixes