Fixing broken main functionality.