Added debug functions. Added byte conversion functions (thanks JG).