Fix undefined in non-browser envs