Pulling in @kennethlimcp's changes manually