fixed missing pointer casts when using atomic ops.