Added changes from stateless_randr