Should fix crash reported in #501

Signed-off-by: SkyFire <admin@projectskyfire.org>