On thermodynamic inconsistencies in several photosynthetic and solar cell models and how to fixthem