Was not working correctly with file extensions unknown to pygmenties. Added the -g option to pygmentize command.