Cleaned up some debug code and fixed variale definition for title