Added basic debug logging