Fixed calling OnPlayerJoined() in the wrong place.

This is the first part of a fix for #187.