R: preliminary bug fix and some "=", "<-" changes