Add more logging and debugging