Fixed issues from 3.0.5 merge