Fix settings environment detection