Fix for repetitive code, fixes #99