Alex, use "it was me/it was him" in all of those examples - if you are speaking American English. Use "it was I/it was he" if speaking British English. The British version is more grammatically...