Cleaned up the code. Corrected startup scripts.