Fixing small logic bug in #3655