Fixed rtrim_copy method. Update global log macros