Additional Unit Tests for `script.py`

Also, minor miscellaneous tweaks to exceptions, handling of hex.