Fixed code per comments.