Fixed bug when openning URL in new window (https://tracker.moodle.org/browse/MDL-37015)