Fixed small bugs