Pin test, fixes, cleanup