favicon and environment detection fixes