Another fix for running outside a browser