Fixed small bugs from the merge