fixed some issues reported by php-analyzer