Misc. fixes, particularly sequence generating code

Whilst looking for repeats of the bug in #79 I noticed a number of uses of

 * `1:length(foo)`
 * `1:ncol(foo)` (or similar functions that return an integer for use as the sequence endpoint

The first of these is better done as `seq_along(foo)` which is optimised relative to `:` and we don't need the R-level `length()` call.

The second of these can be done somewhat more efficiently via `seq_len(ncol(foo))`

A side effect is that these alternatives are robust to things like `1:0`, though many of the uses altered in these commits are unlikely to be prone to that.

This PR also fixes a couple of not-needed `return()` calls.