Several improvements

See commits descriptions