Fixed coding conventions issues. Added test

... + fixed  some minor errors