small patch for --no-graphics mode and small bug fix

fixed --no-graphics bug noted in issue #1322