Fix -Wmaybe-uninitialized warnings
Avoid further checks if ret is already false
[Cleanup]