Adam's bug fix.