Decided to finally fix this part the proper way. Verifies whether it's Mac and if so, uses GNU coreutils as it should, otherwise reverting to the original behavior.