Code review, minor fixes