setRenderer fix and unit tests
Adding guard around setRenderer