Fixed size types instead of unsigned char for numbers.

* uint8_t instead of unsigned char should be better in terms of compatibility;
* Fix Clang compilation issues by using uint16_t for stack size. The uint16_t type gives us a range of possible values which is more than sufficient for allowed script length.