Improved error checking in AudioMode plugin