Absolutely - turn off "open safe files after download", and don't manually open anything that you didn't expect to start downloading from a website. That and don't open email attachments you weren't expecting, and you will be safe from not only these particular problems, but probably the next...