Q1. Depends on your ruleset. Which one are you referring to?
Q2. We discussed this a couple weeks ago. Do NOT count the basket, the foul is a common foul and the ball is inbounded by team A at the nearest point of the infraction. i.e. it cannot be a shooting foul because the player was not by definition in the act of shooting.
Check out the original thread:
fouled while "shooting" at wrong basket
(I just edited my post to reflect the correct statement.)