Fix buggy server and authentication