Fix the name of magFilter
Restructure extension finding code
Delete trailing whitespace