Merge from drnic/cpk to pickup foreign_key_present? patch