Fixed test case & refactoring
Merge pull request #40 from nuodb/vduda/DB-8463

Fixed test case & refactoring