Changed the byte encoding to use short constant format in some cases,
and added a few test cases