Fix code to be compilable with latest rustc:
- splitn arguments order
- hasmap indexing

Closes #371