Data types optimizations. Added basic tests