Bugfix: remove always true conditions from qlog.c
Add new test cases