updates:

1. fixed typedefs.
2. added version checking.