added fix from https://github.com/fogleman/Craft/pull/139