Merged in changes suggested by @mwanji from here: RainerW/JBake#1