Fixed first error in #1382
Fixed second error in #1382