Removed compiler warnings, use correct size variables.

* Removed compiler warnings.
* Use correct size variables.