Add missing prototype, and debug print statements