Fixed typo and improved code

* Fixed #318 
* Removed two useless keys