Fix for #373 & #374

This resolves #373 and fixes #374

I think ema forgot this, he was fixed it for me some time ago.
(Trying new GitHub Issue closer via PR)
Signed-off-by: Antes <antes@simplemachines.org>