Code and comments misc. improvements