Functionality implementation and other small fixes.