Fixed some problems in RMI communication