Some small code cleanups

My IDE flagged various small things - a few undefined/unused local vars, some incorrect phpdocs, so I cleaned them up