Added various fixes to the engine; Static variables and so on