Move secrets to env and fix some empty wallet cases