Is it possible for a shape to either have no height/width styles or to be missing one or the other? In that case, you'll be returning values you haven't defined.