Adding fixes based on Michael's comments