Workaround fix for #559
Fixes and added test cases for #559
Merge branch 'trunk' of https://github.com/impetus-opensource/Kundera into trunk