Bug free, Debug mode now excutes completely.

fixed all issues in debug mode