Implemented some checks.Bug fixes.