Merge pull request #2 from lamblin/take-op-c-code-clean

Check that we did not change values by downcasting
Only perform expensive check if the cast is unsafe