Improve safety when relationship doesn't contain primary key
Provide safety for setting values that are nil
Use remove string in flattenKey
Check if local key exists before trying to sort
Clean up
Merge pull request #30 from hyperoslo/fix/safety-and-remote-string

Fix: Safety and remote string