Just to clarify:
Sora's instincts were still in tact, so that's why he was able to control himself and not attack his friends. Also note that even though Sora had darkness in his heart (enabling to have a nobody none the less) he had very little, which also contributes to his ability of self control and awareness (to a degree).
Roxas had little to no memory of his past life since Sora was only a heartless for such a short time. The moving of memories from the heart to body and soul is a gradual process, and it was too short of a transformation for Roxas to gain his full memories.