some code cleanup
Fix bug in main audio loop