Fixed various bugs client and serverside found by testing manually #124