Fixed bug when writing byte[]
- Improving geometry generation/storage