Removed duplicate replace() in toBinary()