fixed code problem

- DATA_KEY_NAME not defined
- missing return statement
added test-cases
Close #6