fixes in light of @coderoshi comments