Fix vuln iteration 1

Some bug-fixes: