Do not gobble errors silently

In some places using syntax like ``err := something`` inside a block causes a new ``err`` variable to shadow the one used to return result from function. This leads to silent error ignoring.

This commit fixes the described problem.