Not that it will avoid errors on the part of the implementor, but if you do a thorough reading of the classic "Applied Cryptography" by Schneier, he pretty much covers all these problems. He covers all the issues such as ECB vs CBC, IVs, HMACs, etc. It's the definitive book on the topic and anyone who is interested in cryptography should buy this book.