Updated with some fixes for standalone mode.

Updated based upon feedback...