Fix bug where byte types were not properly casted