Bug fix - right shifting beyond the size of the datatype