Tweaked some loop bounds, documentation