fix panic problem when the struct has unexported field.

This PR fixes  #283. Also add test about an unexported field.