Merging in toByte logic from next-release 

This functionality is non-invasive and I might be able to utilize it for #658.