Spattering in oil usually means there is water in it, and you probably had the temp a bit too high.
What kind of oil was it? They all have different burning temperatures. I usually find a medium-medium/low flame on a skillet with about 3 Tbsp of oil would work righteously for something like that.
Just make sure you let the pan/oil warm up for about 5 minutes before cooking, that's a bit important too. Otherwise you'll have hot-spots all over your pan.