Fixing collections and adding tests... tests found a bug, go figure.