Revert changes to client.js due to bugs