Tests and fix to languages detection