Fixed bugs accured after merge with sidebar branch.