wrlib: fix possible incorrect shifting operations (Coverity #50204, #50205, #50206)