Emscripten: Fixed compiler error.
Repaced flagsremove Lua function with new removeflags.