Removed debug statements and made a few fixes