We address three problems that limit the use of the atomic force microscope when measuring elastic moduli of soft materials at microscopic scales. The first concerns the use of sharp cantilever tips, which typically induce local strains that far exceed the linear material regime. We show that this problem can be alleviated by using microspheres as probes, and we establish the criteria for their use. The second relates to the common use of the Hertz contact mechanics model, which leads to significant errors when applied to thin samples. We develop novel, simple to use corrections to apply for such cases. Samples that are either bonded or not bonded to a rigid substrate are considered. The third problem concerns the difficulty in establishing when contact occurs on a soft material. We obtain error estimates for the elastic modulus resulting from such uncertainty and discuss the sensitivity of the estimation methods to error in contact point. The theoretical and experimental results are compared to macroscopic measurements on poly(vinyl-alcohol) gels.