Fix debugging function
Handle SQL files in nested directories