Improve style and "undefined" detection