Top-notch improvements from @h-lame