You could try Archocentrus multispinosus (rainbow cichlid), angelfish, Laetacara dorsigera, L. curviceps, Bolivian ram. I'd avoid larger species in a 40 gal. - even relatively peaceful species can be aggressive if crowded.
40 is very small, of the kind of cichlids I keep, only adult Cryptoheros nanoluteus is small enough for that size tank.
Although some of the South American dwarfs, such as those from the genus Apistogramma or Microgeophagus would work.
Below C nanoluteus