Fixed the issues discussed in the merge request #29