First, there can be no offsides on a ball struck from within the penalty area. Once the ball gets in that position, the defense should be all hands on deck and it shouldn't matter where the offensive players are in relation to the defenders.
and/or
Second, for there to be offsides, the offsides player must be the first thing to tough the ball after it leaves the passer/shooter's foot. It's ridiculous that a player can take a shot, have the shot ricochet off a goal post and a teammate is there to put the rebound into the net, only to have the goal nullified because the guy who ended up scoring was offsides when the original shot was taken.