Core pr 4

Merge with PH libraries and minor fixes.