Some new features added to the runtime and fixing some bugs