Format messages more consistently, improve lexical-binding detection