Incorporate fork changes back to @alxmk