fixed some issues running from command line