Improved framework support

If running as stand-alone, comment out bottom part; improves framework flow