some sf bug fixes