Code review and slight fixes