Bug fix to dealing with boxed types