Check the gem name case-insensitive

This disallows gems that only different in case from another gem. This
is a good policy.
Fix resetting ownership