Debugging and fixed logging exceptions