fixed file permission bug and removed debug statements

Can you please merge this pull request also? Thanks!