Fixed bugs in several other functions without xopt (does not have xopt set).