What causes deviation in a magnetic compass?