Prevents crash when invoked from command line