Removed locks in assign calls.

Improved performance for multiple threads.
Added option for length cap.