Add code to run if standalone feature
Bug fix for when gem is called from commandline.