Fixed replace bug when single integer is passed as count