Minor improvements and cleanups

TBR: @dinhviethoa @terrylucas