Fix the file encoding

AppleScript Editor messed it up.
Check for empty set of windows instead of counting them