Fix nginx config and some other bugs.