Added some checks.
Added constant.