Adding RTDP changes from James' main branch