fixing some sed commands, adding in more debug info