Many fixes and new functional