Fixed some problems (found while writing the nzjs rtc wrapper)