Small fixes, logic still flawed