Some server fixes; working on casting