Fixed logging on the onopen() function.