Fix shift operator issues