Merge pull request #2487 from alexanderkyte/wrapper_type_mismatch