Fixes codestyle and inverted logic