[rcpub] Tackle quite a few bugs, and unsafe coding practices.