Implementing some basic debugging to facilitate troubleshooting

Should be pretty straightforward...