After debugging, I finally found the issue and fixed it. Although it was something small, it surely did take me a while to find it.