Well I just tested it with that and they both went to the correct windows. I did have to change "badtext" to 0 so that it wouldn't halt.

Are you sure you don't have a similar script loaded and interfering? Insert debug print statements to make sure you're at the lines you think you are. If you can, provide a single test alias like I did before to reliably demonstrate the problem.