Fixes #413

Thanks @azuwis for spotting the problem