Fix bug in rtrim function call