Fixed type erasure in lists and maps