Refactored code to avoid non-existing error found by clang

Signed-off-by: K-ballo <k@fusionfenix.com>