Fixed #1001

* getVal should return -1 if ch is not found - otherwise out of bounds
* v == 0 should be ok in it referes to the 'A' in BASE_64_CHARS