use rlength rather than length in array assignment. fixes #9