BUG: Fix Qt compilation issue + simplify library logic