Fixed issue #111

Updated as per Fabien's comments.