Modified library form to detect toplevel macro definition properly.