Fixed some issues

Francisco and my last pull requests conflicted, so I fixed the merge conflict.