Fixed bugs introduced by two previous commits

Authored by gepardo on Aug 24 2018, 1:03 PM.