fix two small SGA bugs