updated collection tests and fixed collection safe bugs