Added proper byteswapping functions.