Fixed bug where wrong RenderState variable was set for stencil write.
Added missing Lua bindings.