R1 (complete); A few unrelated bugfixes