Replaced the vector size checks
Changed license in all .cpp and .h
Various fixes
Changed NULL with 0
Applied coding style