PAHMA enhancements and repairs, see individiual commits