Tests beautifying and small bug-fix