Fix errors when running install:run console command

# Fix errors when running install:run console command

There is an undefined method error and a 'cannot call protected method' error.