fixes and refactoring to Tmx.Server