fixed warnings, syntax, sleep threads (client)