Fixed problems from comments