Fix #410: x.toByte and x.toShort should ensure the proper range.
Merge pull request #433 from sjrd/fix-short-byte-ranges

Fix #410: x.toByte and x.toShort should ensure the proper range.