Fix a few minor mistakes

Found using static analyzer: hhvm --hphp -t analyze
Will add a ticket for the remaining non-trivial issues.