Fix mutation observer check to not produce errors