Added more debug functions.