Fixed some server side related bugs