#9 and #19: Updating code from 3.0