Pin logic, fixed some handler logic.