Merge "Add debug functions." into gingerbread