Removed undefined behavior

Undefined order of operations