Correctly detect and transform collections. Fixes #30.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>