Fix EPK detection
Fix fencepost error in EPK length calc