Rename some variables, free memory etc.
Remove debug output