Replace abspath() with realpath(), and remove redundant call to normpath()