Latest changes from @echooocc based on feedback.