Fixed "Client index 0 is invalid" error.