Spam crashes

Fixed some crashing caused whilst using spam module.