Little bit of cleanup on sql and graphs.