Fixed missing variable checks

Signed-off-by: jdarwood007 <github+smf@sleepycode.com>
Merge branch 'release-2.1' of https://github.com/illori/SMF2.1 into release-2.1
Revert "Revert "fixes bug #725""

This reverts commit 39ca05aa9df9b17f3609d3142fb69fe3939826a5.
Revert "Revert "fixes bug #725""

This reverts commit 41719d9149bc2399e4b83e86e42930e55ab1e354.
Revert "fixes bug #725"

This reverts commit a11133aeea77607cafadea091f08e92e79b129cd.
Revert "fixes bug #725"

This reverts commit 2e5b8ff4dbb002c4f1df0f5b281d31e3b604e0ee.