Fixed bugs - not debugged with client yet