Extension parsing logic

Closes #304
Merge pull request #322 from ChrisBeaumont/issue_304

Extension parsing tweak