Test for #79 and needed modifications of queries
Fixes #79 in the easiest way
Fixes #78, which was really not so simple due to some strange side effects