Test coverage and cleanups

I wonder if the resizing field should be volatile or this method synchronised.