various server fixes and improvements