Added corpus download script for webapp. Fixed some issues in other scripts.