Added logic to serialize byte when used as object type

Signed-off-by: rpgmaker <olamide.bakre@gmail.com>