Replace some sys.errors with proper exceptions.
Merge pull request #345 from tixxit/fix/down-with-runtimeexception

Replace some sys.errors with proper exceptions.