fix SG for underscores to close #490

also cleanup trailing whitespace