Fix for new way to change the language base on the actual filename.

In addition to bug fix, I also replaced the tabs with spaces to ensure code lines up correctly and optimized the $q definition by putting it inside the first if.

Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>