Fix nested type serialization
Style consistency
Merge branch 'pr/327'

Fix #327