Fixes to make lib compatable with PTP

@nlintz can you test with PTP?