Resolves #23.

* Fixed an issue with preserving the array keys